import java.io.File;

public class Test01 {
    public static void main(String[] args) {
        File f1=new File("C:\\Users\\sun\\Desktop\\temp.txt");
        File f2=new File("C:/Users/sun/Desktop/temp.txt");
        File f3=new File("C:"+File.separator+"Users"+File.separator+"sun"+File.separator+"Desktop"+File.separator+"temp.txt");
        System.out.println(f1.length());
        System.out.println(f2.length());
        System.out.println(f3.length());
        // Directory
        File f4=new File("C:/Users/sun/Desktop/crack");
        System.out.println(f4.length()); //读取目录大小（是其本身大小，不包括其中文件）
        // Not exist file
        File f5=new File("C;/Users/sun/Desktop/aa.txt");
        System.out.println(f5.exists());
        // 定位模块中文件
        File f6=new File("IO_src/aa.txt");
        System.out.println(f6.exists());
        //File f7=new File("SE_Study/IO_src/aa.txt");
        //System.out.println(f7.exists());  false
    }
}
